home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 1
/
LIGHT-ROM 1 (Amiga Library Services)(1994).iso
/
ffdisks
/
d883.lha
/
BBBBS
/
BBBBS59.lha
/
rexx
/
BBBBSdemon.baud
< prev
next >
Wrap
Text File
|
1992-05-01
|
3KB
|
91 lines
/* $VER: 5.1 BBBBSdemon.baud 1 May 1992 (1.5.92)
USAGE: run rx BBBBSdemon.baud ; run after BaudBandit is running
This program handles those cases where BBBBS might fail to properly
log-off after a disconnect during transfer or message entry.
(The classic case is a hangup during message entry, followed by
numerous "RING"s... The BBS sees the RING and thinks the user is
still entering text, so it doesn't close the buffer!)
Reboots after about 10 minutes (4 decreasing checks) if the user
didn't logout (BBS_level~=''), and there is no carrier.
Does nothing the 1st time, then tries closing the buffer,
and finally, on the third check, tries CTRL-C & ESC (nasty reset!).
If all this fails to reset the BBS, the program boot is
run if is found in the C: directory.
*/
IF SHOW('P','BBBBS_DEMON') THEN EXIT
CALL OPENPORT('BBBBS_DEMON')
CR='0D'x
chances=1
DO WHILE chances<5 /* 4 checks */
CALL DELAY(50*300%chances) /* pauses get shorter with trouble */
p=GETPKT('BBBBS_DEMON') /* ANY message means time to quit */
IF p~='0000 0000'x THEN
DO WHILE p~='0000 0000'x /* empty the port */
DO
t=REPLY(p,0)
p=GETPKT('BBBBS_DEMON')
END
chances=5 /* ... and quit */
END
ELSE IF GETCLIP('BBS_level')='' | ~SHOW('P','BAUD') THEN
chances=1 /* inactive bbs */
ELSE
DO
ADDRESS BAUD
dcd
IF RC=0 THEN
DO
chances=chances+1 /* no carrier, so... */
IF chances=3 THEN
DO
Send '\r/END\r' /* be sure buffer is closed */
IF GETCLIP('BBS_level')~='' THEN
DO
CALL DELAY(100)
Send '\ah'
END
END
IF chances=4 THEN Send '\aB\e' /* ESCape to stop transfer */
IF chances=5 THEN /* time to die */
DO
SAY 'BBBBS_Demon calling reboot in 20 seconds...'
Send '\rBBBBS_Demon calling reboot in 20 seconds...\r'
chances=1
bbspath=GETCLIP('BBS_path')
IF bbspath~='' THEN
ADDRESS COMMAND 'date >'bbspath'Numbers/LastDemonBoot'
DO i=1 TO 3
CALL sound_badlogoff(i)
END
IF EXISTS('c:boot') THEN
DO
CALL DELAY(250)
ADDRESS COMMAND boot
END
END
END
ELSE chances=1
ADDRESS
END
END
CALL CLOSEPORT('BBBBS_DEMON')
EXIT
sound_badlogoff:
ARG mult .
ADDRESS BAUD
DO bp=1 TO 24
Beep (3200-bp*30*mult)
END
RETURN
/* BBBBSdemon.baud */